package com.itheima.Test02;

import java.util.ArrayList;

public class Demo测试类 {
    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        ArrayList<Person> list2 = new ArrayList<>();
        ArrayList<Student> list3 = new ArrayList<>();
        ArrayList<JavaStudent> list4 = new ArrayList<>();
        ArrayList<UIStudent> list5 = new ArrayList<>();
        ArrayList<Teacher> list6 = new ArrayList<>();
        ArrayList<JavaTeacher> list7 = new ArrayList<>();
        ArrayList<UITeacher> list8 = new ArrayList<>();
        //方法1所有集合都可以调用;
        print1(list1);
        print1(list2);
        print1(list3);
        print1(list4);
        print1(list5);
        print1(list6);
        print1(list7);
        print1(list8);
        //方法2String不能调用;
        print2(list2);
        print2(list3);
        print2(list4);
        print2(list5);
        print2(list6);
        print2(list7);
        print2(list8);
        //方法3只又list3 ,4,5 可以调用;
        print3(list3);
        print3(list4);
        print3(list5);
        //方法4list1 和 list 5 ,6,7,8不能调用;
        print4(list2);
        print4(list3);
        print4(list4);


    }
    public static void print1(ArrayList< ? > list){

    }
    public static void print2(ArrayList<? extends Person> list){

    }
    public static void print3(ArrayList<? extends Student> list){

    }
    public static void print4(ArrayList< ? super JavaStudent> list){

    }
}
